# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=gsfonts
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=20180524
pkgrel=2
pkgdesc='(URW)++ Core Font Set [Level 2] (mingw-w64)'
url='https://github.com/ArtifexSoftware/urw-base35-fonts'
arch=('any')
license=('AGPL3')
makedepends=('git')
install=font-${CARCH}.install
_commit=b758567463df532414c520cf008e27d9448b55a4  # master
source=("git+https://github.com/ArtifexSoftware/urw-base35-fonts#commit=${_commit}")
sha256sums=('SKIP')

pkgver() {
  cd urw-base35-fonts
  echo $(TZ=UTC git show -s --pretty=%cd --date=format-local:%Y%m%d HEAD)
}

package() {
  cd urw-base35-fonts
  install -Dt "${pkgdir}${MINGW_PREFIX}/share/fonts/${_realname}" -m644 fonts/*.otf
  install -Dt "${pkgdir}${MINGW_PREFIX}/share/appdata" -m644 appstream/*.xml

  install -d "${pkgdir}"${MINGW_PREFIX}/etc/fonts/conf.{avail,d}
  for _f in fontconfig/*.conf; do
     _fn="${pkgdir}${MINGW_PREFIX}/etc/fonts/conf.avail/69-${_f##*/}"
     install -m644 ${_f} "${_fn}"
     ln -srt "${pkgdir}${MINGW_PREFIX}/etc/fonts/conf.d" "${_fn}"
  done
}
